home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
yerk
/
mps231ss.hqx
/
Mops source
/
More classes
/
dateTime
< prev
next >
Wrap
Text File
|
1992-09-17
|
1KB
|
67 lines
\ Date - Date/time support
\ 01/15/85 cbd Version 1
\ 03/11/87 rfl ability to put any date in and print it
\ also changed basicstr to bytes
\ July 90 mrh Mops version. Gives choice as to day and month order.
decimal
true value DMY? \ Set true for day/month/year order (Aussie)
scon DAYNAMES "SunMonTueWedThuFriSat"
:code SECS2DATE \ ( secs dtRec -- )
pop a0
pop d0
call Secs2Date
;code
:code GETDATETIME \ Apparently Apple don't want us to just
\ do $ 20C @ any more.
clr.l -(a6)
move.l a6,a0
exg a6,a7
call ReadDateTime
exg a6,a7
rts
;code
: DIG2 <# # # #> type ;
:class DATETIME super{ object }
int Year
int Month
int Day
int Hour
int Minute
int Second
int dayOfWeek
:m GET: \ Gets the system date and time
getDateTime ^base secs2date ;m
:m PUT: ^base secs2date ;m
:m PRINTDAY:
get: dayOfWeek 1- 3 * dayNames drop + 3 type ;m
:m PRINTDATE:
get: day get: month
DMY? IF swap THEN
dig2 & / emit dig2 & / emit
get: year 1900 - dig2 ;m
:m PRINTTIME:
get: hour dig2 & : emit
get: minute dig2 & : emit get: second dig2 ;m
:m PRINT:
printday: self space printdate: self
2 spaces printtime: self ;m
;class
dateTime sysDate